<template>
    <n-form ref="formRef" inline :label-width="80" :model="formValue" label-placement="left" :show-feedback="false">
        <n-form-item label="员工编号" path="username">
            <n-input v-model:value="formValue.username" />
        </n-form-item>
        <n-form-item label="员工名称" path="nickname">
            <n-input v-model:value="formValue.nickname" />
        </n-form-item>
        <n-form-item label="手机号" path="mobile">
            <n-input v-model:value="formValue.mobile" />
        </n-form-item>
        <n-form-item>
            <n-button attr-type="submit" @click="doSearch" :disabled="disabled"> 查询 </n-button>
        </n-form-item>
    </n-form>
</template>

<script setup lang="ts">
import { FormInst } from "naive-ui"

const formRef = ref<FormInst | null>(null)

const formValue = ref<Recordable>({})

const disabled = ref<boolean>(false)

const emits = defineEmits(["finish"])

const doSearch = async (e: MouseEvent) => {
    e.preventDefault()
    emits("finish", formValue.value)
}
</script>
